#include"processBar.h"
#include<unistd.h>

typedef void (*callback_t)(int);

void  download(callback_t cb)
{
    int total=1000;
    int curr=0;
    while(curr <=total)
    {

        usleep(50000);
        int rate = curr*100/total;
        cb(rate);
        curr+=10;
    }
    printf("\n");
}

int main()
{
    download(processbar);
    download(processbar);
    download(processbar);
    download(processbar);
    download(processbar);
    return 0;
}
